package com.bird.system.domain.menu.vo

import com.bird.component.lang.common.exception.ServiceException

enum class MenuType(val value:String) {
    //1-菜单；2-目录；3-外链；4-按钮权限
    MENU("1"),
    CATALOG("2"),
    OUT_LINK("3"),
    BUTTON("4");

    companion object {
        fun from(value: String): MenuType {
            return when (value) {
                "1" -> MENU
                "4" -> BUTTON
                "3" -> OUT_LINK
                "2" -> CATALOG
                else -> throw ServiceException("没有这个菜单类型: $value")
            }
        }
    }
}